package day2001;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class ccc {
    public static void main(String[] args) throws Exception {
        Class a = anli.class;
        Method b = a.getDeclaredMethod("xin_xi2", int.class, int.class, String.class);
        Constructor c = a.getDeclaredConstructor();
        c.setAccessible(true);//给构造方法设置权限
        Object d = c.newInstance();
        b.setAccessible(true);//给成员方法设置权限
        b.invoke(d,10,20,"www");

        Constructor cc = a.getDeclaredConstructor(String.class,int.class,int.class);
        cc.setAccessible(true);
        Object dd = cc.newInstance("30",20,50);
        b.setAccessible(true);
        b.invoke(dd,11,22,"45");
    }
}
